package cn.aresoft.web.action.custom;

import java.util.List;

import cn.aresoft.framework.exception.ActionException;
import cn.aresoft.framework.support.action.BaseActionSupport;
import cn.aresoft.logic.service.face.custom.IUser2Service;
import cn.aresoft.model.User2;
import cn.aresoft.web.action.ActionResult;

public class User2Action extends BaseActionSupport {

	private static final long serialVersionUID = 1L;
	
	
	public String save() throws ActionException{
		iUser2Service.insert("insertUser2", user2);
		return ActionResult.INSERT;
	}

	public String update() throws ActionException{
		iUser2Service.update("updateUser2", user2);
		return ActionResult.UPDATE;
	}
	
	public String delete() throws ActionException{
		iUser2Service.remove("deleteUser2ByKey", user2);
		return ActionResult.DELETE;
	}
	
	public String query() throws ActionException{
		try{
			iUser2Service.test1();
			List rs = findForSubListI("getListByUser2", user2);
			request.setAttribute("rs", rs);
		}catch(Exception e){
			e.printStackTrace();
		}
		return ActionResult.QUERY;
	}
	

	
	private IUser2Service iUser2Service;
	private User2 user2;

	public User2 getUser2() {
		return user2;
	}

	public void setUser2(User2 user2) {
		this.user2 = user2;
	}

	public void setIUser2Service(IUser2Service iUser2Service) {
		this.iUser2Service = iUser2Service;
	}
}